home *** CD-ROM | disk | FTP | other *** search
- Path: howland.reston.ans.net!psinntp!psinntp!psinntp!psinntp!usenet
- From: grantp@usa.pipeline.com(Pete Grant)
- Newsgroups: comp.lang.c++
- Subject: Re: URGENT..Help Needed!!
- Date: 23 Mar 1996 13:47:18 GMT
- Organization: Kalevi, Inc.
- Message-ID: <4j0vd6$kn8@news1.h1.usa.pipeline.com>
- References: <4j0h0u$9dj$1@sydney.DIALix.oz.au>
- NNTP-Posting-Host: 38.8.60.7
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete Grant)
- X-Newsreader: Pipeline v3.5.0
-
- On Mar 23, 1996 20:41:50 in article <URGENT..Help Needed!!>,
- 'gonza@sydney.DIALix.oz.au (A and K Gonzalez)' wrote:
-
-
- >Hello
- >
- >My name is Katyha Gonzalez and I need help with my programming.
- >
- >My main questions are how do initialise an array to zero or set them with
-
- >spaces?
- >
- Depends on the array. Here are two examples:
-
- const int somesize = 1000;
- int iarray[somesize];
- memset(iarray, 0, sizeof(iarray));
-
- char * carray = new char[somesize];
- memset(carray, ' ', somesize);
- >How can I search through my arrays looking for a space in them? Do I use
- >a while loop??
-
- #include <string.h>
- char * pc = strchr(carray, ' ');
- >
- >And lastly, how do I list all items in the array, one per line??
- >
- // switching from C to C++ (this is comp.lang.c++)
- for (int i = 0; i < somesize; i++)
- cout << carray[i] << endl;
-
- >These answers or help/hints would be greatly appreciated, so please send
- >me some help on
- >
- If you get an "A" (or do they grade numerically in Australia?),
- I want half of it :-)
-
- --
- Pete Grant
- Kalevi, Inc.
- Software Engineering & development
-